﻿<Application x:Class="Ripple.TestClient.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:vm="clr-namespace:Ripple.TestClient.ViewModels"
             xmlns:conv="clr-namespace:Ripple.TestClient.Converters"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <Application.Resources>

        <Style TargetType="{x:Type MenuItem}">
            <Setter Property="Header" Value="{Binding Path=DisplayName}" />
            <Setter Property="Command" Value="{Binding Path=Command}" />
            <Setter Property="ToolTip" Value="{Binding Path=ToolTip}" />
            <Setter Property="InputGestureText" Value="{Binding Path=InputGestureText}" />

            <Style.Triggers>
                <DataTrigger Binding="{Binding Path=IsSeparator}" Value="true">
                    <Setter Property="MenuItem.Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="{x:Type MenuItem}">
                                <Separator Style="{DynamicResource {x:Static MenuItem.SeparatorStyleKey}}" />
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </DataTrigger>
            </Style.Triggers>
        </Style>

        <HierarchicalDataTemplate
            DataType="{x:Type vm:MenuItemViewModel}"
            ItemsSource="{Binding Path=ListItems}">
        </HierarchicalDataTemplate>

        <Style x:Key="BasicGridStyle" TargetType="{x:Type DataGrid}">
            <Setter Property="HorizontalScrollBarVisibility" Value="Visible" />
            <Setter Property="VerticalScrollBarVisibility" Value="Visible" />
            <Setter Property="GridLinesVisibility" Value="None" />
            <Setter Property="SelectionMode" Value="Single" />
            <Setter Property="IsReadOnly" Value="True" />
            <Setter Property="IsSynchronizedWithCurrentItem" Value="True" />
            <Setter Property="AlternationCount" Value="2" />
            <Setter Property="ItemsSource" Value="{Binding ListItems}" />
            <Setter Property="SelectedItem" Value="{Binding SelectedItem, Mode=TwoWay}" />
            <Setter Property="CanUserAddRows" Value="False" />
            <Setter Property="CanUserDeleteRows" Value="False" />
            <Setter Property="AutoGenerateColumns" Value="False" />
            <Setter Property="FrozenColumnCount" Value="1" />
            <Setter Property="AlternationCount" Value="2" />
            <Setter Property="AlternatingRowBackground" Value="Azure" />
            <Setter Property="HeadersVisibility" Value="Column" />
        </Style>

        <Style x:Key="CurrencyValueStyle" TargetType="TextBlock">
            <Setter Property="HorizontalAlignment" Value="Right" />
        </Style>

        <Style x:Key="RightAlignColumnHeaderStyle" TargetType="{x:Type DataGridColumnHeader}">
            <Setter Property="HorizontalContentAlignment" Value="Right" />
        </Style>

        <conv:NullToVisibilityConverter x:Key="NullToVisibilityConverter" />
        <BooleanToVisibilityConverter x:Key="BoolToVisibiltyConverter" />
    </Application.Resources>
</Application>